package helloworld.ioc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import junit.framework.TestCase;

public class TestSpringIOC extends TestCase {
	private IAction action;

	public IAction getAction() {
		return action;
	}

	public void setAction(IAction action) {
		this.action = action;
	}

	public void testSpringIOC() {
		ApplicationContext ac = new FileSystemXmlApplicationContext(
		"/spring/helloworld/ioc/applicationContext.xml");
		TestSpringIOC t = (TestSpringIOC)ac.getBean("testSpringIOC");
		assertEquals(t.getAction().SayHello(), "你好");
	}
}
